
Ext.Loader.setConfig({enabled: true});  
		Ext.Loader.setPath('Ext.ux', 'http://localhost:8501/test10/cfbose/otherscript/extjs/examples/ux');
		Ext.require([
			'Ext.ux.grid.FiltersFeature',
			'Ext.grid.plugin.BufferedRenderer',
			'Ext.toolbar.Paging',
			'Ext.ux.ajax.JsonSimlet',
		    'Ext.ux.ajax.SimManager',
			'Ext.util.*',
			'Ext.grid.*',
			'Ext.data.*'
		]);


var filters = {
        ftype: 'filters',
        encode: true, // json encode the filter query
        local: false,   // defaults to false (remote filtering)
	    filters: [{
            type: 'string',
            dataIndex: 'REFERENCECODE'
        }]
    };

	
	
//var groupingFeature = Ext.create('Ext.grid.feature.Grouping');


Ext.define('Screening.view.recruitment.screeningandreservation.globalpoolview', {     
	extend: 'Ext.grid.Panel',
	alias: 'widget.globalpool',     
	width: '100%', 
    features: [filters],  
    multiSelect: true,
    clicksToEdit: 2,
	selModel: {
		    pruneRemoved: false
	},
	//verticalScroller: {
	   // xtype: 'paginggridscroller'
	  //}, 
	viewConfig: {
	    forceFit: false,
		trackOver: false,
	    emptyText: '<h1 style="margin:20px">No matching results</h1>'
	},
	
	initComponent: function() {     
	    this.plugins = [
			Ext.create('Ext.grid.plugin.CellEditing', {
			    clicksToEdit: 2
    	    })
			
		];
		this.store = 'recruitment.screeningandreservation.globalpoolstore';
		this.bbar = Ext.create('Ext.toolbar.Paging', {
				        store: 'recruitment.screeningandreservation.globalpoolstore', 
				        displayInfo: true,
				        emptyMsg: "No topics to display"
				   });
		this.tbar = [{
		  	text: 'Fetch Selected',
			action: 'fetch',
			cls: 'field-margin'
		  },{
		  	xtype: 'tbseparator'
		  },{
		  	text: 'View Selected',
			action: 'view',
			cls: 'field-margin'
		  },{
		  	xtype: 'tbseparator'
		  },{
		  	text: 'Release Selected',
			action: 'release',
			cls: 'field-margin'
		  },{
		  	xtype: 'tbseparator'
		  },{
		  	text: 'Export to Excel',
			action: 'toexcelglobal',
			cls: 'field-margin'
		  },'->',
		  {
		  	xtype: 'displayfield',
			name: 'gpdisp',
			value: ' '
		  }];
		  
		this.columns =  [{
            xtype: 'rownumberer',
			locked: true,
            width: 50,
            sortable: false
	       },{  
		    text: 'Company Code',
		    dataIndex: 'COMPANYCODE',
			locked: true,
			groupable: true,
			editor: {
				xtype: 'textfield'
			},
		    width: 100
		  },{
		    text: 'Position First Priority',
		    dataIndex: 'POSITIONFIRSTPRIORITY',
			filterable: true,
		    width: 300,
			editor: {
				xtype: 'combobox',
				name: 'POSITIONFIRSTPRIORITY',
				editable: false,
				cls: 'field-margin',
				width: 300,
				queryMode: 'remote',
				store: 'recruitment.screeningandreservation.positionstore',
				displayField: 'positionname',
				valueField: 'positioncode'
			}
		  },{
		    text: 'Position Second Priority',
		    dataIndex: 'POSITIONSECONDPRIORITY',
			filterable: true,
		    width: 300,
			editor: {
				xtype: 'combobox',
				name: 'POSITIONSECONDPRIORITY',
				editable: false,
				cls: 'field-margin',
				width: 300,
				queryMode: 'remote',
				store: 'recruitment.screeningandreservation.positionstore',
				displayField: 'positionname',
				valueField: 'positioncode'
			}
		  },{
		    text: 'Position Third Priority',
		    dataIndex: 'POSITIONTHIRDPRIORITY',
		    width: 300,
			filterable: true,
			editor: {
				xtype: 'combobox',
				name: 'POSITIONTHIRDPRIORITY',
				editable: false,
				cls: 'field-margin',
				width: 300,
				queryMode: 'remote',
				store: 'recruitment.screeningandreservation.positionstore',
				displayField: 'positionname',
				valueField: 'positioncode'
			}
		  },{
		    text: 'Expected Salary',
		    dataIndex: 'EXPECTEDSALARY',
		    width: 100,
			filterable: true
		  },{
		    text: 'Current Salary',
		    dataIndex: 'CURRENTSALARY',
		    width: 100,
			filterable: true
		  },{
		    text: 'Date of Application',
		    dataIndex: 'DATEOFAPPLICATION',
			editor: {
				xtype: 'datefield'
			},
		    width: 150,
			renderer: Ext.util.Format.dateRenderer('n/j/Y'),
			filter: {
				type: 'date',
				format: 'Y-n-j'
			}
		  },{
		    text: 'Reference Code',
		    dataIndex: 'REFERENCECODE',
		    width: 150,
			filterable: true
		  },{
		    text: 'Firstname',
		    dataIndex: 'FIRSTNAME',
		    width: 200,
			filterable: true
		  },{
		    text: 'Lastname',
		    dataIndex: 'LASTNAME',
		    width: 200,
			filterable: true
		  },{
		    text: 'Age',
		    dataIndex: 'AGE',
		    width: 50,
			filterable: true
		  },{
		    text: 'Gender',
		    dataIndex: 'GENDER',
		    width: 50,
			filterable: true
		  },{
		    text: 'Civil Status',
		    dataIndex: 'CIVILSTATUS',
		    width: 70,
			filterable: true
		  },{
		    text: 'Citizenship',
		    dataIndex: 'CITIZENSHIP',
		    width: 70,
			filterable: true
		  },{
		    text: 'College School',
		    dataIndex: 'COLLEGESCHOOL',
		    width: 250,
			filterable: true
		  },{
		    text: 'Course',
		    dataIndex: 'COLLEGECOURSE',
			width: 300,
			filterable: true
		  },{
		    text: 'Is Graduate?',
		    dataIndex: 'COLLEGEISGRAD',
		    width: 80,
			filterable: true
		  },{
		    text: 'Post Graduate School',
		    dataIndex: 'POSTGRADSCHOOL',
		    width: 250,
			filterable: true
		  },{
		    text: 'Course',
		    dataIndex: 'POSTGRADCOURSE',
			width: 300,
			filterable: true
		  },{
		    text: 'Is Graduate?',
		    dataIndex: 'POSTGRADISGRAD',
		    width: 80,
			filterable: true
		  },{
		    text: 'Vocational School',
		    dataIndex: 'VOCATIONALSCHOOL',
		    width: 250,
			filterable: true
		  },{
		    text: 'Course',
		    dataIndex: 'VOCATIONALCOURSE',
			width: 300,
			filterable: true
		  },{
		    text: 'Is Graduate?',
		    dataIndex: 'VOCATIONALISGRAD',
		    width: 80,
			filterable: true
		  },{
		    text: 'Present Address',
		    dataIndex: 'PRESENTADDRESSPOSTAL',
		    width: 400,
			filterable: true
		  }]
		
		
		this.callParent(arguments);
	}
});
